package com.haierp.service.bi.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.haierp.mapper.bi.BiFreightMapper;
import com.haierp.mapperBi.BiDailiReportMapper;
import com.haierp.mapperBi.BiFavourableMonthMapper;
import com.haierp.mapperBi.BiHeroListMapper;
import com.haierp.mapperBi.BiLogisticFreightMapper;
import com.haierp.mapperBi.BiPurchaseProportionMapper;
import com.haierp.model.bi.BiDailiReport;
import com.haierp.model.bi.BiFavourableMonth;
import com.haierp.model.bi.BiFreight;
import com.haierp.model.bi.BiHeroList;
import com.haierp.model.bi.BiLogisticFreight;
import com.haierp.model.bi.BiPurchaseProportion;
import com.haierp.service.bi.IBiFreightService;

@Service("biFreightService")
public class BiFreightServiceImpl extends SuperServiceImpl<BiFreightMapper, BiFreight> implements IBiFreightService {
	@Autowired
	private BiFreightMapper biFreightMapper;
	@Autowired
	private BiPurchaseProportionMapper biPurchaseProportionMapper;
	@Autowired
	private BiLogisticFreightMapper biLogisticFreightMapper;
	@Autowired
	private BiHeroListMapper biHeroListMapper;
	@Autowired
	private BiDailiReportMapper biDailiReportMapper;
	@Autowired
	private BiFavourableMonthMapper biFavourableMonthMapper;

	@Override
	public List<BiLogisticFreight> selectBiFreightByGmtCreate(Long companyId) {
		EntityWrapper<BiLogisticFreight> entityWrapper = new EntityWrapper<>();
		entityWrapper.where("company_id={0}", companyId);
		entityWrapper.orderBy("dimension_date", false);
		return biLogisticFreightMapper.selectList(entityWrapper);
	}

	@Override
	public List<BiPurchaseProportion> selectBiBuyerPurchaseSuccess() {
		EntityWrapper<BiPurchaseProportion> entityWrapper = new EntityWrapper<>();
		entityWrapper.orderBy("dimension_date", false);
		List<BiPurchaseProportion> biPurchaseProportionList = biPurchaseProportionMapper.selectList(entityWrapper);
		return biPurchaseProportionList;
	}

	@Override
	public List<BiFreight> selectPurchaseHeroicListByTime() {
		return biFreightMapper.selectPurchaseHeroicListByTime();
	}

	@Override
	public List<BiFreight> selectSaleHeroicListByTime() {
		return biFreightMapper.selectSaleHeroicListByTime();
	}

	@Override
	public List<BiFreight> selectRecordHeroicListByTime() {
		return biFreightMapper.selectRecordHeroicListByTime();
	}

	@Override
	public List<BiFreight> selectDeliverHeroicListByTime() {
		return biFreightMapper.selectDeliverHeroicListByTime();
	}

	@Override
	public List<BiFreight> selectPackHeroicListByTime() {
		return biFreightMapper.selectPackHeroicListByTime();
	}

	@Override
	public List<BiDailiReport> selectdailiOrderRateByDay() {
		EntityWrapper<BiDailiReport> entityWrapper = new EntityWrapper<>();
		entityWrapper.orderBy("dimension_date", false);
		return biDailiReportMapper.selectList(entityWrapper);
	}

	@Override
	public List<BiDailiReport> selectdailiOrderRateByMonth() {
		return biDailiReportMapper.biSelectdailiOrderRateByMonth();
	}

	@Override
	public List<BiHeroList> selectBiHeroListByTime() {
		EntityWrapper<BiHeroList> entityWrapper = new EntityWrapper<>();
		return biHeroListMapper.selectList(entityWrapper);
	}

	@Override
	public List<BiFavourableMonth> selectBiFavourableByMonth() {
		EntityWrapper<BiFavourableMonth> entityWrapper = new EntityWrapper<>();
		entityWrapper.orderBy("dimension_date", false);
		return biFavourableMonthMapper.selectList(entityWrapper);
	}
}
